package com.zhn.evsi.client;

import com.dtflys.forest.annotation.BaseRequest;
import com.dtflys.forest.annotation.Request;
import com.dtflys.forest.annotation.Retry;
import com.dtflys.forest.annotation.Var;
import com.zhn.evsi.domain.dto.evsi.common.EvsiIconDTO;
import com.zhn.evsi.domain.dto.evsi.alliance.EvsiAllianceInfoDTO;
import com.zhn.evsi.interceptor.TokenExceptionInterceptor;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
@BaseRequest(baseURL = "${eveData}${eveDataSns}", interceptor = TokenExceptionInterceptor.class)
@Retry(maxRetryCount = "3", maxRetryInterval = "1000")
public interface AllianceClient {

    /**
     * 联盟列表
     * */
    // https://esi.evetech.net/latest/alliances/?datasource=tranquility
    @Request(
            url = "/alliances/?datasource=tranquility",
            type = "GET"
    )
    List<Integer> allianceList();

    /**
     * 获取联盟详情
     * */
    // https://esi.evetech.net/latest/alliances/1354830081/?datasource=tranquility
    @Request(
            url = "/alliances/{alliances}/?datasource=tranquility",
            type = "GET"
    )
    EvsiAllianceInfoDTO alliancesInfo(@Var("alliances") Integer alliances);

    /**
     * 获取联盟下属军团id
     * */
    // https://esi.evetech.net/latest/alliances/1354830081/corporations/?datasource=tranquility
    @Request(
            url = "/alliances/{alliances}/corporations/?datasource=tranquility",
            type = "GET"
    )
    List<Integer> allianceCorporations(@Var("alliances") Integer alliances);

    /**
     * 获取联盟图标
     * */
    // https://esi.evetech.net/latest/alliances/1354830081/icons/?datasource=tranquility
    @Request(
            url = "/alliances/1354830081/icons/?datasource=tranquility",
            type = "GET"
    )
    EvsiIconDTO allianceIcon(@Var("alliances") Integer alliances);
}
